package routers

import (
	"github.com/gin-gonic/gin"
	"go_demo_1/api"
)

func Auth(r *gin.Engine) {
	//http://127.0.0.1:8888/auth?Username=q1mi&Password=q1mi123
	r.GET("/auth", api.AuthHandler)
	//http://127.0.0.1:8888/home
	//使用token获取Authorization   Bearer是指验证方式，账号密码，因为方式获取的为空格分割的0下标位，所以是放在token之前，增加空格符
	//Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VybmFtZSI6InExbWkiLCJleHAiOjE1OTA1NTcwNDAsImlzcyI6Im15LXByb2plY3QifQ.5_HxOAN3tk-eXUcvQkfHJH6sqFo5T5p6-oEGBXU5NMY
	r.GET("/home", api.JWTAuthMiddleware(), api.HomeHandler)
}
